#include<bits/stdc++.h>
using namespace std;
#define endl '\n'

typedef long long ll;
const int N = 1e6 + 10;
ll a[N];

void sort1(ll a[],int l,int r)
{
	if(l>=r) return;
	int x = a[(l+r)/2];
	int i=l-1,j=r+1;
	while(i<j)
	{
		do i++;while(a[i]<x);
		do j--;while(a[j]>x);
		if(i<j)swap(a[i],a[j]);
	}
	sort1(a,l,j);
	sort1(a,j+1,r);
}

void solve()
{
	int n;
	cin >> n;
	
	for(int i = 0 ;i < n; i ++ ) cin >> a[i];
	sort1(a, 0, n-1);
	for(int i = 0 ;i < n; i ++ ) cout << a[i] << " ";
	cout << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int t = 1;
	//cin >> t;
	while(t -- ) solve();
	return 0;
}

